package javaCode.chapter11.exception_;

/**
 * @author 徐州城
 * @version 1.0
 */
public class ClassCastException_ {
    public static void main(String[] args) {
        A b = new B(); //向上转型
        B b2 = (B) b; //向下转型
//        C c = (C) b2; //这里会抛出 类型转换异常

        A a = new C();
        C c1 = (C) a;
    }
}

class A {}

class B extends A {}

class C extends A {}